Deep Learning with PyTorch: Guide for Beginners and Intermediate by P. Jerry N

Deep Learning with PyTorch: Guide for Beginners and Intermediate by P. Jerry N

Author:P., Jerry N. [P., Jerry N.]
Language: eng
Format: epub, pdf
Published: 2019-01-27T16:00:00+00:00


use_gpu = torch.cuda.is_available()

Visualizing some Images

To be able to understand the augmentations of the data, let us visualize some of the training images. This is the code for this:

def imshow(inp, title=None):

inp = inp.numpy().transpose((1, 2, 0))

mean = np.array([0.485, 0.456, 0.406])

std = np.array([0.229, 0.224, 0.225])

inp = std * inp + mean

plt.imshow(inp)

if title is not None:

plt.title(title)

plt.pause(0.001) # pause a bit so that plots are updated

# Obtain a batch of the training data

inputs, classes = next(iter(dataloders['train']))



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.